package com.beans;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class User1 {
    public static void main1(String[] args) {
        BeanFactory factory = new XmlBeanFactory(
                new ClassPathResource("spring-config.xml"));
        User user = (User) factory.getBean("user");
        User user1 = factory.getBean(User.class);
        User user2 = factory.getBean("user", User.class);
        user.sayHi("zjk");
    }
}
